<!--
 * @Author: zhangxiangsheng 1026583651@qq.com
 * @Date: 2024-06-19 18:54:07
 * @LastEditors: zhangxiangsheng 1026583651@qq.com
 * @LastEditTime: 2024-06-24 16:33:59
 * @FilePath: \appGly\pages\Station\components\xqview2.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
-->
<template>
	<view class="" style="height: 100%">
		<scroll-view scroll-y="true" class="scroll-Y" refresher-background="#f4f7f8">
			<view class="list">
				<view class="item" :class="{ noafter: key + 1 == list.length }" v-for="(item, key) in list" :key="key"
					@click="itemtap(item)">
					<view class="label">
						{{ item.label }}
					</view>
					<view class="label" v-if="item.value">
						{{ item.value }}
					</view>
					<view v-else class="icon">
						<u-icon name="arrow-right" size="20" color="#969696"></u-icon>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>
<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => {
					return {};
				},
			},
		},
		data() {
			return {
				Station: {},
			};
		},
		created() {
			this.init();
		},
		computed: {
			list() {
				let r = [{
						label: this.$z.$t("站点名称"),
						value: this.Station.pcs
					},
					{
						label: this.$z.$t("站点信息"),
						url: `/pages/Station/Stationedt?id=${this.Station.id}`,
					},
					{
						label: this.$z.$t("用户管理"),
						url: `/pages/USearch/USearch?pcs=${this.Station.id}`,
					},
					{
						label: this.$z.$t("站点配置"),
						url: `/pages/Station/StationHD/StationHD?pcs=${this.Station.id}`,
					},

					{
						label: this.$z.$t("分润设置"),
						url: `/pages/Station/StatFrecharts/StatFrecharts?id=${this.Station.id}`,
					},
				].map((e) => {
					return {
						...e,
						label: this.$z.$t(e.label),
					};
				});
				return r;
			},
		},
		methods: {
			async init() {
				let Station = await this.$z.request("/Station", {
					id: this.item.pcs,
				});
				this.Station = Station[0];
				console.log(Station, "Station");
			},
			itemtap(item) {
				console.log(item);
				if (item.url) {
					this.$z.gopage(item.url);
				}
			},
		},
	};
</script>
<style lang="scss" scoped>
	.Stationaddbtn {
		margin: 20rpx;
		background: #fff;
		height: 88rpx;
		border-radius: 8rpx;
		display: flex;
		align-items: center;
		justify-content: center;

		.iconfont {
			margin-right: 8rpx;
		}
	}

	.scroll-Y {
		height: 100%;
	}

	.list {
		.item {
			height: 104rpx;
			display: flex;
			background-color: #fff;
			align-items: center;
			position: relative;

			.label {
				width: 260rpx;
				padding-left: 30rpx;
			}

			.icon {
				position: absolute;
				right: 30rpx;
			}

			&::after {
				content: "";
				height: 2rpx;
				position: absolute;
				left: 30rpx;
				bottom: 0;
				right: 0;
				background-color: #cfcfcf;
				transform: scaleY(0.5);
			}

			&.noafter {
				&::after {
					display: none;
				}
			}
		}
	}
</style>